﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us" dir="ltr" class="gecko win">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <meta name="description" content="The showcase page for a deck in game, contains all card in a vaild deck. Sword Girls Anime magic card game." />
    <meta name="keywords" content="Anime,web game,magic card,fan page" />
    <meta name="geo.region" content="KR-11" />
    <meta name="geo.placename" content="Seoul" />
    <meta name="geo.position" content="37.56165;126.982103" />
    <meta name="ICBM" content="37.56165, 126.982103" />
    <link href="style.css" rel="stylesheet" type="text/css" />
    <style>
        tr td a {
            transition: all 0.5s !important;
            -webkit-transition: all 0.5s !important;
            -ms-transition: all 0.5s !important;
            -o-transition: all 0.5s !important;
        }

            tr td a:hover {
                text-decoration: none !important;
                color: #F0A;
            }
    </style>
    <title>Deck Showcase</title>
    <script type="text/javascript">
        // only used for standalone version
        var Loader = { datastream: null, cards: [] };
    </script>
    <script src="SwordGirlData.js" type="text/javascript"></script>
    <script type="text/javascript">
        var hostImage = "http://www.sword-girls.com/Img/Card/";
        var GET = {};
        var queryURL = window.location.search.substring(1).split("&");
        for (var i = 0, max = queryURL.length; i < max; i++) {
            if (queryURL[i] === "") // check for trailing & with no param
                continue;

            var paramID = queryURL[i].split("=");
            GET[decodeURIComponent(paramID[0])] = decodeURIComponent(paramID[1] || "");
        }
        var cardsplit1 = GET.deck.split('D');
        var cardarray = cardsplit1[1].split('C');

        function find(id) {
            var card = false;
            for (var i = 0; i < Loader.cards.length; ++i) {
                if (Loader.cards[i].id == id) {
                    card = Loader.cards[i];
                }
            }
            return card;
        }
    </script>
</head>

<body class="SGO-cardbuilder-deck">
    <script type="text/javascript">
        document.body.id = 'javascript-enabled'
    </script>
    <div id="page" class="deckviewer">
        <div id="style-wrapper">
            <span id="style-deckviewer-ctl"></span>
            <span id="style-deckviewer-ctr"></span>
            <span id="style-deckviewer-cbl"></span>
            <span id="style-deckviewer-cbr"></span>
            <div id="style-wrapper-1">
                <div id="style-wrapper-2">
                    <script>
                        document.write('<center><h1 style="text-decoration:none !important;">Deck Showcase</h1>');
                        document.write('<a target="_blank" href="index.php?' + queryURL + '&compression=false">Save this deck</a></center>');
                    </script>
                    <hr />
                    <table id="deckviewer-character">
                        <thead>
                            <tr>
                                <th>Life</th>
                                <th>Card</th>
                                <th>Name and Ability</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>

                                <script type="text/javascript">
                                    var cardid = cardsplit1[0].substring(0, 6);
                                    var card = find(cardid);
                                    if (card == false) {
                                        card = Loader.cards[0];
                                    }
                                    if (card.id > 129999) {
                                        card = Loader.cards[0];
                                    }
                                    var cardImg;
                                    if (card.id == '200440') {
                                        cardImg = '200440L.jpg';
                                    }
                                    else if (card.id == '200465') {
                                        cardImg = '200465L.jpg';
                                    }
                                    else if (card.id == '300303') {
                                        cardImg = '300303L.jpg';
                                    }
                                    else if (card.id == '110280') {
                                        cardImg = '110280L.jpg';
                                    }
                                    else if (card.id == '200467') {
                                        cardImg = '200467L.jpg';
                                    }
                                    else if (card.id == '300581') {
                                        cardImg = '300581L.jpg';
                                    }
                                        /*110280, 200467, 300581*/
                                    else if (card.id == '100258') {
                                        cardImg = '100258L.jpg';
                                    }
                                    else if (card.id == '100259') {
                                        cardImg = '100259L.jpg';
                                    }
                                    else if (card.id == '100260') {
                                        cardImg = '100260L.jpg';
                                    }
                                    else if (card.id == '100261') {
                                        cardImg = '100261L.jpg';
                                    }
                                    else {
                                        cardImg = hostImage + card.id + 'L.jpg';
                                    }

                                    document.write('<td class="life"><span class="lifesymbol">♥</span>' + card.life + '</td>');
                                    document.write('<td class="faction"><a href="card.php?id=' + card.id + '" target="_blank"><img src="assets/' + card.faction + '.png" /></a></td>');
                                    document.write('<td class="card"><img src="' + cardImg + '" /></td>');
                                    document.write('<td class="info"><a href="card.php?id=' + card.id + '" target="_blank"><big>' + card.name + '</big></a>');
                                    document.write('<p>Points: ' + card.CP + '<br />Rarity: ' + card.rarity + '<br /><br />' + card.ability + '</p>');
                                    document.write('</td>');
                                    document.title += " " + card.name;
                                    var points = 0;
                                    points += card.CP;
                                </script>
                            </tr>
                        </tbody>
                    </table>

                    <table id="deckviewer-cards">
                        <thead>
                            <tr>
                                <th colspan="2">Basic Info</th>
                                <th>Size</th>
                                <th>Card</th>
                                <th>Name and Ability</th>
                                <th>Copies</th>
                            </tr>
                        </thead>
                        <tbody>

                            <script type="text/javascript">
                                var spells = 0;
                                var followers = 0;

                                for (var i = 0; i < cardarray.length; ++i) {
                                    if (cardarray[i].length >= 8) {
                                        var cardid = cardarray[i].split('P')[1];
                                        var card = find(cardid);
                                        var number = cardarray[i].split('P')[0];

                                        if (card.life !== undefined) {
                                            card.type = 'character';
                                        }
                                        else if (card.stats !== undefined) {
                                            card.type = 'follower';
                                            followers += parseInt(number);
                                        }
                                        else if (card.size !== undefined) {
                                            card.type = 'spell';
                                            spells += parseInt(number);
                                        }
                                        //spells += (card.type == 'spell' ? number : 0);
                                        //followers += (card.type == 'follower' ? number : 0);
                                        points += card.CP * number;

                                        if (card != false && card.id > 129999) {

                                            document.write('<tr><td class="stats">');
                                            if (card.id > 300000) {
                                                document.write(card.stats.atk + ' / ' + card.stats.def + ' / ' + card.stats.stm + '</td>');
                                            } else {
                                                document.write('&nbsp; </td>');
                                            }
                                            var cardImg;
                                            if (card.id == '200440') {
                                                cardImg = '200440L.jpg';
                                            }
                                            else if (card.id == '200465') {
                                                cardImg = '200465L.jpg';
                                            }
                                            else if (card.id == '300303') {
                                                cardImg = '300303L.jpg';
                                            }
                                            else if (card.id == '110280') {
                                                cardImg = '110280L.jpg';
                                            }
                                            else if (card.id == '200467') {
                                                cardImg = '200467L.jpg';
                                            }
                                            else if (card.id == '300581') {
                                                cardImg = '300581L.jpg';
                                            }
                                                /*110280, 200467, 300581*/
                                            else if (card.id == '100258') {
                                                cardImg = '100258L.jpg';
                                            }
                                            else if (card.id == '100259') {
                                                cardImg = '100259L.jpg';
                                            }
                                            else if (card.id == '100260') {
                                                cardImg = '100260L.jpg';
                                            }
                                            else if (card.id == '100261') {
                                                cardImg = '100261L.jpg';
                                            }
                                            else {
                                                cardImg = hostImage + card.id + 'L.jpg';
                                            }
                                            document.write('<td class="faction"><img src="assets/' + card.faction + '.png" /></td>');
                                            document.write('<td class="size">' + card.size + '</td>');
                                            document.write('<td class="card"><img src="' + cardImg + '" /></td>');
                                            document.write('<td class="info"><a href="card.php?id=' + card.id + '" target="_blank"><big>' + card.name + '</big></a>');
                                            var ablty = card.ability;
                                            ablty = ablty.replace(/\[/g, '<span style="font-weight:bold;">[');
                                            ablty = ablty.replace(/"<br >/g, '<br >"');
                                            ablty = ablty.replace(/\]/g, ']</span><br >');
                                            ablty = ablty.replace(/\/\//g, '<br >//');
                                            document.write('<p>Points: ' + card.CP + ' // Rarity: ' + card.rarity + '<br /><br />' + ablty + '</p></td>');
                                            document.write('<td class="copies">x<strong>' + number + '</strong></td></tr>');
                                        }
                                    }
                                }
                                document.write('<br /><p style="text-align: left; margin-left:245px; margin-bottom:15px;">Followers: <strong>' + followers + '</strong> // Spells:<strong>' + spells + '</strong> // Points: <strong>' + points + '</strong></p>');
                            </script>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</body>
</html>